package com.sky.mapper.admin;

import com.github.pagehelper.Page;
import com.sky.dto.CategoryPageQueryDTO;
import com.sky.pojo.Category;
import com.sky.vo.CategoryVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @Description CategoryMapper
 * @Author shejunlian
 * @Date 2024-07-22
 */
@Mapper
public interface CategoryMapper {
    /**
     * 新增分类
     * @param category
     * @return
     */
    void addClassify(Category category);

    /**
     * 分类分页查询
     * @param categoryPageQueryDTO
     * @return
     */
    Page<Category> pageClassify(CategoryPageQueryDTO categoryPageQueryDTO);

    /**
     * 根据id删除分类
     * @param id
     */
    @Delete("DELETE from category where id =#{id}")
    void deleteClassify(Long id);

    /**
     * 修改分类
     * @param category
     */
    void update(Category category);

    /**
     * 根据类型查询分类
     * @param type
     * @return
     */
    List<CategoryVo> insertClassify(Integer type);
}
